/* function func1(x) {
    return new Promise((resolve, reject) => {
        console.log("promise1")
    })
}
async function test() {
    try {
        //把await及获取它的值的操作放在try里
        let n = await func1('小')
        console.log('赢了')
    } catch (error) {
        //失败的操作放在catch里
        console.log('输了' + error)
    }
}
console.log(test()) */

/* async function func() {
    console.log("func")
    await function(){
        console.log(12345)
        return 111
    }()
    console.log("end")
}
console.log(func())
console.log(123) */
function *test(){
    // console.log(1)
    const a = yield "a"
    // console.log(2)
    console.log(a)
    const b = yield "b"
    // console.log(3)
    console.log(b)
}
let iter = test()
const a = iter.next()
console.log(a)
